<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>导入订单明细</title>
	</head>

	<body>
	
	
	 <div>
	   <a class="btn btn-primary" href="${ctx}/yhdLead/init">返回同步页面</a>
	</div>
	
	
		
	<c:if test="${status eq '1' }">
	
	<!-- 同步结果 -->
	<table  class="table table-striped table-bordered table-condensed">
		<thead>
		<tr bgcolor="#3FA8F3" >
		   <th colspan="14"  style="height: 30px;font-size: 18px;color: white; vertical-align: middle;" >订单同步结果 </th>
		<tr>
		</thead>
		<tbody>
		   
			<tr>
			  <td>数量总量（条）</td><td>${number}</td> 
			</tr>
			<tr>
			  <td>同步成功数据（条）</td><td>${fn:length(normal)}</td>
			</tr>
			<tr>
			  <td>疑似数据（条）</td><td>${fn:length(suspect)}</td>
			</tr>
			<tr>
			  <td>同步失败数据（条）</td><td>${fn:length(exception)}</td>
			</tr>
		</tbody>
	</table>
	
	
	<!-- 同步失败的 -->
	<table  class="table table-striped table-bordered table-condensed">
		<thead>
		<tr bgcolor="#3FA8F3" >
		   <th colspan="2"  style="height: 30px;font-size: 18px;color: white; vertical-align: middle;" >以下订单导入失败,请核对后重新同步</th>
		<tr>
		</thead>
		<tbody>
		    <c:if test="${empty exception or exception.size() eq 0}">
			     <tr><td colspan="2" height="50" style="vertical-align:middle; text-align: center;color: gray;font-size: 20px;">无数据</td></tr>
		   </c:if>
			<c:forEach items="${exception}" var="obj">
			<tr>
			   <tr>
						<td>
							${obj.ordeno}
						</td>
						<td>
							${obj.customerOrdeno}
						</td>
						<td>
							${obj.gymemo}
						</td>	
					
			</tr>
			</c:forEach>
		</tbody>
	</table>
	
	<!-- 疑似数据 -->
	<table  class="table table-striped table-bordered table-condensed">
		<thead>
		<tr bgcolor="#3FA8F3" >
		   <th colspan="2"  style="height: 30px;font-size: 18px;color: white; vertical-align: middle;" >以下订单数据导入异常,请核对后重新同步</th>
		<tr>
		</thead>
		<tbody>
		    <c:if test="${empty suspect or suspect.size() eq 0}">
			     <tr><td colspan="2" height="50" style="vertical-align:middle; text-align: center;color: gray;font-size: 20px;">无数据</td></tr>
		   </c:if>
			<c:forEach items="${suspect}" var="obj">
			<tr>
			   <tr>
						<td>
							${obj.ordeno}
						</td>
						<td>
							${obj.customerOrdeno}
						</td>
						<td>
							${obj.gymemo}
						</td>	
					
			</tr>
			</c:forEach>
		</tbody>
	</table>
	
	
	<div style="color: #3FA8F3;">
		订单总数量:<font size="20">${fn:length(normal)}</font>
		</div>
	<table id="contentTable"
			class="table table-striped table-bordered table-condensed">
			<thead>
				<tr>
				    <th>
						能容订单号
					</th>
					<th>
						商家订单号
					</th>
					<th>
						来源单号
					</th>
					<th>
						运单号
					</th>
					<th>
						收货人
					</th>
					<th>
						目的地
					</th>
					<th>
						审核时间
					</th>
					
					<th>
						查询
					</th>
				</tr>
			</thead>
			<tbody>
				<c:forEach items="${normal}" var="order">
					<tr>
					   
						<td>
							${order.ordeno}
						</td>
						<td>
							${order.customerOrdeno}
						</td>
						<td>
							${order.fromno}
						</td>
						<td>
							${order.waybillNo}
						</td>
						<td>
							${order.recena}
						</td>
						<td>
							${order.provna}
						</td>
						<td>
							${order.crtime}
						</td>
						
						
						<td>
							<a href="#ordersDetailed"
								onclick="getAjaxOrders('${order.id}')" role="button"
								class="btn" data-toggle="modal"> 订单详情 </a>

							<a href="#itemsDetailed"
								onclick="getAjaxItems('${order.id}')" role="button"
								class="btn" data-toggle="modal"> 商品详情 </a>
						</td>
					</tr>
				</c:forEach>
			</tbody>
		</table>

		
		<div style="display: none; width: 1000" class="modal hide fade"
			tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
			aria-hidden="true" id="ordersDetailed">
			<div class="modal-header">
				<h3 id="myModalLabel">
					订单详细信息
				</h3>
			</div>
			<div class="modal-body">
				<table class="table table-striped table-bordered table-condensed"
					id="modalBodyOrders"></table>
			</div>
			<div class="modal-footer">
				<button class="btn" data-dismiss="modal" aria-hidden="true">
					关闭
				</button>
			</div>
		</div>

		<div style="display: none; width: 1000" class="modal hide fade"
			tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
			aria-hidden="true" id="itemsDetailed">
			<div class="modal-header">
				<h3 id="myModalLabel">
					商品详细信息
				</h3>
			</div>
			<div class="modal-body">
				<table class="table table-striped table-bordered table-condensed"
					id="modalBodyItems"></table>
			</div>
			<div class="modal-footer">
				<button class="btn" data-dismiss="modal" aria-hidden="true">
					关闭
				</button>
			</div>
		</div>
	</c:if>
	<c:if test="${status eq '2' }">
	
	<!-- 同步结果 -->
	<table  class="table table-striped table-bordered table-condensed">
		<thead>
		<tr bgcolor="#3FA8F3" >
		   <th colspan="14"  style="height: 30px;font-size: 18px;color: white; vertical-align: middle;" >商品同步结果 </th>
		<tr>
		</thead>
		<tbody>
		   <tr>
			  <td>信息</td><td>${message}</td> 
			</tr>
			<tr>
			  <td>数量总量（条）</td><td>${number}</td> 
			</tr>
			<tr>
			  <td>已同步数据（条）</td><td>${fn:length(normal)}</td>
			</tr>
			<tr>
			  <td>异常数据（条）</td><td>${fn:length(exception)}</td>
			</tr>
		</tbody>
	</table>
	
	
	<!-- 异常数据 -->
	<table  class="table table-striped table-bordered table-condensed">
		<thead>
		<tr bgcolor="#3FA8F3" >
		   <th colspan="2"  style="height: 30px;font-size: 18px;color: white; vertical-align: middle;" >以下商品数据异常,请核对后重新同步</th>
		<tr>
		</thead>
		<tbody>
		    <c:if test="${empty exception or exception.size() eq 0}">
			     <tr><td colspan="2" height="50" style="vertical-align:middle; text-align: center;color: gray;font-size: 20px;">无数据</td></tr>
		   </c:if>
			<c:forEach items="${exception}" var="obj">
			<tr>
			   <td>${obj.bar}</td>
			   <td>${obj.skuName}</td>
			   <td>${obj.sku}</td>
			</tr>
			</c:forEach>
		</tbody>
	</table>
	
	
	<table id="contentTable"
			class="table table-striped table-bordered table-condensed">
			<thead>
				<tr>
				   
					<th>
						商品货号
					</th>
					<th>
						商品名称
					</th>
					<th>
						商品编码
					</th>
					
				</tr>
			</thead>
			<tbody>
				<c:forEach items="${normal}" var="obj">
					<tr>
					   
						<td>
							${obj.bar}
						</td>
						<td>
							${obj.skuName}
						</td>
						<td>
							${obj.sku}
						</td>
						
					</tr>
				</c:forEach>
			</tbody>
		</table>

		
	
	</c:if>
	</body>
</html>
